package exception.demo1;

public class ThrowDemo {
    public static void main(String[] args) {
        Student stu=new Student();
        try{
            stu.setAge(1000);
            System.out.println("此人的年龄为：" + stu.getAge() + "岁");
        }catch (Exception e){
            System.out.println("年龄有误");
        }
    }
}
